package engine.gui;

import engine.Engine;
import engine.game.Manager;
import engine.graphics.FontManager; 

import static org.lwjgl.opengl.GL11.* ; 

public class Label extends GUIObject{
	
	private static final long serialVersionUID = 1L;

	private String fontName = FontManager.S_FONT_13_black; 
	private String caption = "" ; 

	public Label(Manager m, int x, int y, int w, int h) {
		super(m, x, y, w, h);
		init(); 
	}

	public Label(Manager m, int x, int y, int w, int h, String caption) {
		this(m, x, y, w, h);
		this.setCaption(caption); 
	}
	
	public Label(Manager m, ParentObject parent, String caption){
		super(m, parent); 
		this.setCaption(caption);
	}
	
	public void setCaption(String caption){
		if(!(caption == null))
			this.caption = caption ; 
	}
	
	public String getCaption(){
		return this.caption ; 
	}
	
	public String getFontName(){
		return this.fontName ; 
	}
	
	public void setFontName(String fName){
		this.fontName = fName ; 
	}
	
	public void init(){
		super.init(); 
		this.disableHovering(); 
		this.disableClicking(); 
	}
	
	public void render(){
		super.render(); 
		glPushMatrix(); 
		FontManager.drawString(this.fontName, (int)this.getX(),
							Engine.HEIGHT-(int)this.getY()-this.getObjectHeight(), 
							this.getCaption()) ;
		glPopMatrix(); 
	}

	@Override
	public void getInput() {
	}
	
}
